package fun.shuofeng.juc.reentranlock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class ReentrantLockExample {
    private static final ReentrantLock lock = new ReentrantLock();

    public static void main(String[] args) {
        // 加锁
        lock.lock();
        try {
            // do something...
        } finally {
            // 解锁
            lock.unlock();
        }
    }
}
